package com.osfw.activiti.domain;

import com.alibaba.fastjson.JSONObject;
import com.osfw.system.entity.manage.SysUser;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Map;

/**
 * 流程申请信息
 */
@Data
@Accessors(chain = true)
public class ProcessApplyInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    /* 申请标题 */
    private String title;

    /* 申请事项 */
    private String busiType;

    /* 业务主键 */
    private String busiKey;

    /* 发起人 */
    private SysUser startUser;

    /* 流程KEY */
    private String procKey;

    /* 全局变量（可为空） */
    private Map<String, Object> variables;

    /* 操作类型 */
    private String operType;

    /* 流程状态 */
    private String procState;

    /* 当前阶段 */
    private String actKey;

    /* 当前阶段 */
    private String actName;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("title", getTitle())
                .append("busiType", getBusiType())
                .append("busiKey", getBusiKey())
                .append("startUser", getStartUser())
                .append("procKey", getProcKey())
                .append("variables", getVariables())
                .append("variables", JSONObject.toJSONString(getVariables()))
                .toString();
    }

}
